package com.ordersystem.mappers;

import com.ordersystem.domain.Dish;
import com.ordersystem.domain.DishRank;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author : asus1020
 * @version : [v1.0]
 * @className : DishMapper
 * @description : [描述说明该类的功能]
 * @createTime : [2022/3/26 13:57]
 * @updateUser : asus1020
 * @updateTime : [2022/3/26 13:57]
 * @updateRemark : [描述说明本次修改内容]
 */
@Repository
public interface DishMapper {
    int addDish(Dish dish);
    int deleteDish(Integer did);
    int updateDish(Dish dish);
    Dish findDishById(Integer did);
    List<Dish>findDishes(@Param("query") String query,@Param("cid") Integer cid);
    //int updateDishSellVolume(@Param("did") Integer did,@Param("number") Integer number);
    int saveDishImg(@Param("imgUrl") String imgUrl,@Param("did") Integer did);
    List<Dish>findShoppingCar(Integer uid);
    List<Dish>findOrderDish(@Param("dids") List<Integer>dids);
    List<Dish>findOrderDishByUidAndDids(@Param("dids") List<Integer>dids,@Param("uid") Integer uid);

    int addShoppingTrolley(@Param("uid") Integer uid,@Param("did") Integer did,@Param("number") Integer number);
    int queryShoppingTrolley(@Param("uid")Integer uid,@Param("did") Integer did);
    int updateShoppingTrolley(@Param("uid") Integer uid,@Param("did") Integer did,@Param("number") Integer number);
    List<Dish>findDishesByCid(@Param("cid") Integer cid,@Param("uid")Integer uid);
    int deleteShoppingTrolley(@Param("uid")Integer uid,@Param("did")Integer did);
    int finishShoppingTrolley(@Param("uid")Integer uid,@Param("dids")List<Integer> dids);
    List<DishRank>getDishRank(Integer rank);
    int updateDishSellVolume(Integer gid);
    List<Dish>findDishByGidList(@Param("gidList")List gidList);
    int statisticsDishNumberByCid(@Param("cid") Integer cid);
}
